#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>

int main()
{
    int fd = open("./log.txt", O_RDWR | O_CREAT, 0666);
    if (fd < 0) {
        perror("open");
        exit(1);
    }
    printf("fd : %d\n", fd);
    char* buffer = "abcdef";
    write(fd, buffer, strlen(buffer));

    close(fd);
    return 0;
}
